package com.lncd.backend.dto;

import com.lncd.backend.model.GeoFence;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class GeoFenceDTO {
    private Long id;
    private Long creatorId;
    private Long targetUserId;
    private String name;
    private double centerLatitude;
    private double centerLongitude;
    private double radius;
    private boolean active;

    public static GeoFenceDTO fromEntity(GeoFence geoFence) {
        GeoFenceDTO dto = new GeoFenceDTO();
        dto.setId(geoFence.getId());
        dto.setCreatorId(geoFence.getCreator().getId());
        dto.setTargetUserId(geoFence.getTargetUser().getId());
        dto.setName(geoFence.getName());
        dto.setCenterLatitude(geoFence.getCenterLatitude());
        dto.setCenterLongitude(geoFence.getCenterLongitude());
        dto.setRadius(geoFence.getRadius());
        dto.setActive(geoFence.isActive());
        return dto;
    }
} 